using System.Linq;
using Common;

namespace SSettings.ExperimentColumn
{
	public class ADColumns : AQColumns
	{
		protected override GridColumns CreateColumns()
		{
			return new ADColumns();
		}

		protected override void InitCustomColumn()
		{
			base.InitCustomColumn();
			_Columns.Add(new ColumnInfo
			{
				FieldName = "WellCell.Well.Result.TypeNo",
				Header = Utility.GetMessage("typing"),
				Info = 2,
				AllowDelete = false,
				AllowEditing = false
			});
			_Columns.Add(new ColumnInfo
			{
				FieldName = "WellCell.Well.Result.QualityFactor",
				Header = Utility.GetMessage("quality_factor"),
				Info = 2,
				AllowDelete = false,
				AllowEditing = false
			});
		}

		public override void SetVisibilityDefault()
		{
			base.SetVisibilityDefault();
			_Columns.Where((ColumnInfo s) => s.FieldName == "SampleTargetItem.Result.CtValue").FirstOrDefault().Visibility = false;
			_Columns.Where((ColumnInfo s) => s.FieldName == "SampleTargetItem.Result.CnValue").FirstOrDefault().Visibility = false;
			_Columns.Where((ColumnInfo s) => s.FieldName == "SampleTargetItem.Result.RnValue").FirstOrDefault().Visibility = true;
			_Columns.Where((ColumnInfo s) => s.FieldName == "WellCell.Well.Result.TypeNo").FirstOrDefault().Visibility = true;
			_Columns.Where((ColumnInfo s) => s.FieldName == "WellCell.Well.Result.QualityFactor").FirstOrDefault().Visibility = true;
		}
	}
}
